package com.swpu.seckill.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.swpu.seckill.pojo.SeckillOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Oxygen
 * @since 2022-03-17
 */
@Mapper
public interface SeckillOrderMapper extends BaseMapper<SeckillOrder> {

    /**
     * 保存秒杀订单信息
     * @param seckillOrder
     */
    void savaOrder(SeckillOrder seckillOrder);

    /**
     * 查询当前用户是否已经秒杀过该商品
     * @param userId
     * @param goodsId
     * @return
     */
    SeckillOrder selectSeckillOrder(@Param("userId") Long userId, @Param("goodsId") Long goodsId);
}
